package org.example.erp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.erp.domain.Employee;
import org.example.erp.mapper.EmployeeMapper;
import org.example.erp.service.EmployeeService;
import org.springframework.stereotype.Service;

@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {

    @Override
    public Page<Employee> getEmployeeAndRanks(Page<Employee> page, QueryWrapper<Employee> queryWrapper) {
        return page.setRecords(this.baseMapper.getEmployeeAndRanks(page,queryWrapper));
    }

    @Override
    public boolean addEmployee(Employee employee) {
        return this.baseMapper.addEmployee(employee)>0?true:false;
    }
}
